﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace MapEditor.MapService
{
    public class MapEnties : List<MapEntity>
    {
        private const string DATA_FILE = @"GameData\";

        public MapEnties()
        {
            getListMapFromData();
        }

        public void getListMapFromData()
        {
            DirectoryInfo directInfos = new DirectoryInfo(DATA_FILE);
            var files = directInfos.GetFiles("*.txt", SearchOption.AllDirectories);
            foreach (FileInfo file in files)
            {
                this.Add(new MapEntity(file.Name.ToString().Replace(".txt", "").Trim(), file.Name.ToString()));
            }
        }
    }
}
